#!/bin/bash

#Helper Functions
function link_file() {
    source="${PWD}/$1"
    target="${HOME}/$2"

    if [ -e "${target}" ] && [ ! -L "${target}" ]; then
        mv $target $target.linfeng.bak
    fi

    #echo "ln -sf ${source} ${target}"
    rm -f ${target}
    ln -sf ${source} ${target}
}

#Set Environment for Vim
link_file "vim" ".vim"
link_file "vimrc" ".vimrc"
#sudo cp javascript.vim /usr/share/vim/vim73/syntax/


#Subversion
echo "export SVN_EDITOR=vim" >> ~/.bashrc

#VirtualEnv
echo "source /usr/local/bin/virtualenvwrapper.sh" >> ~/.bashrc


#Screen
link_file "screenrc" ".screenrc"
